package miku.firstgame.entity
{
	import com.saia.starlingPunk.SPEntity;
	import com.saia.starlingPunk.SPMask;
	import com.saia.starlingPunk.extensions.ogmopunk.OgmoProject;

	import starling.display.Image;

	public class TestTank extends SPEntity
	{
		public function TestTank()
		{
			super(32, 32, "testTank");

		}

		override public function added():void
		{
			super.added();
			setupGraphic();
		}

		private function setupGraphic():void
		{
			var tileSet:Vector.<Image> = OgmoProject.getTileSet("tank");
			var image:Image = new Image(tileSet[1].texture); //textureAtlas.getTexture("burger"));
			addChild(image);
		}

		override public function removed():void
		{
			removeChildren(0, -1, true);
			super.removed();
		}

		override public function update():void
		{
			super.update();

			if (collide("fire", x, y))
			{
				this.world.remove(this);
			}
		}
	}
}
